package cn.udrm.water.base.v1.waterdelivery.repository;

import javax.validation.constraints.NotNull;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.EntityGraph.EntityGraphType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import cn.udrm.water.base.v1.waterdelivery.entities.SteepSlope;

@Repository
public interface SteepSlopeRepository extends JpaRepository<SteepSlope, String>
			, JpaSpecificationExecutor<SteepSlope>{
	
	@EntityGraph(value="SteepSlope.all", type=EntityGraphType.FETCH)
	public Page<SteepSlope> findAll(@NotNull Specification<SteepSlope> specification, Pageable pageable);
	
	@Query(value="FROM SteepSlope w WHERE w.id=?1")
	@EntityGraph(value="SteepSlope.all", type=EntityGraphType.FETCH)
	public SteepSlope findAllById(String id);
}
